package com.ray.utils.impl;

import com.ray.utils.Cal;
import org.springframework.stereotype.Component;

@Component()
public class CalImpl implements Cal {
    public int add(int num1, int num2) {
//        System.out.println("add的参数是"+ num1+"--"+num2);
        int result = num1 + num2;
//        int i = 1/0;
//        System.out.println("add的result是"+ result);
        return result;
    }

    public int sub(int num1, int num2) {
//        System.out.println("sub的参数是"+ num1+"--"+num2);
        int result = num1 - num2;
//        System.out.println("sub的result是"+ result);
        return result;
    }

    public int mul(int num1, int num2) {
//        System.out.println("mul的参数是"+ num1+"--"+num2);
        int result = num1 * num2;
//        System.out.println("mul的result是"+ result);
        return result;
    }

    public int div(int num1, int num2) {
//        System.out.println("div的参数是"+ num1+"--"+num2);
        int result = num1 / num2;
//        System.out.println("div的result是"+ result);
        return result;
    }
}
